Optimal. Leaf size=116 \[ -\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x}{16 a^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{8 d (a+i a \tan (c+d x))^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.119034, antiderivative size = 116, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3540, 3526, 3479, 8} \[ -\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x}{16 a^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{8 d (a+i a \tan (c+d x))^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3540
Rule 3526
Rule 3479
Rule 8
Rubi steps
\begin{align*} \int \frac{\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{\int \frac{a-2 i a \tan (c+d x)}{(a+i a \tan (c+d x))^3} \, dx}{2 a^2}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{\int \frac{1}{(a+i a \tan (c+d x))^2} \, dx}{4 a^2}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{\int \frac{1}{a+i a \tan (c+d x)} \, dx}{8 a^3}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{\int 1 \, dx}{16 a^4}\\ &=-\frac{x}{16 a^4}-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}
Mathematica [A] time = 0.387729, size = 69, normalized size = 0.59 \[ -\frac{(\cos (4 (c+d x))-i \sin (4 (c+d x))) ((1+8 i d x) \sin (4 (c+d x))+(8 d x+i) \cos (4 (c+d x))-4 i)}{128 a^4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.026, size = 118, normalized size = 1. \begin{align*}{\frac{{\frac{i}{16}}}{d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{{\frac{i}{8}}}{d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}+{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{d{a}^{4}}}-{\frac{1}{4\,d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}-{\frac{1}{16\,d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{d{a}^{4}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.52891, size = 128, normalized size = 1.1 \begin{align*} -\frac{{\left (8 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{128 \, a^{4} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.12666, size = 119, normalized size = 1.03 \begin{align*} \begin{cases} \frac{\left (128 i a^{4} d e^{8 i c} e^{- 4 i d x} - 32 i a^{4} d e^{4 i c} e^{- 8 i d x}\right ) e^{- 12 i c}}{4096 a^{8} d^{2}} & \text{for}\: 4096 a^{8} d^{2} e^{12 i c} \neq 0 \\x \left (- \frac{\left (e^{8 i c} - 2 e^{4 i c} + 1\right ) e^{- 8 i c}}{16 a^{4}} + \frac{1}{16 a^{4}}\right ) & \text{otherwise} \end{cases} - \frac{x}{16 a^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.55757, size = 117, normalized size = 1.01 \begin{align*} -\frac{\frac{2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) + 1\right )}{a^{4}} - \frac{2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) - 1\right )}{a^{4}} + \frac{3 i \, \tan \left (2 \, d x + 2 \, c\right )^{2} - 6 \, \tan \left (2 \, d x + 2 \, c\right ) + 5 i}{a^{4}{\left (\tan \left (2 \, d x + 2 \, c\right ) - i\right )}^{2}}}{128 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]